package models;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author eagle
 */
@Entity
@Table(name = "CALIFICACION", catalog = "sischool2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Calificacion.findAll", query = "SELECT c FROM Calificacion c"),
    @NamedQuery(name = "Calificacion.findByIdCalificacion", query = "SELECT c FROM Calificacion c WHERE c.idCalificacion = :idCalificacion"),
    @NamedQuery(name = "Calificacion.findByCalificacion", query = "SELECT c FROM Calificacion c WHERE c.calificacion = :calificacion"),
    @NamedQuery(name = "Calificacion.findByPeriodoeva", query = "SELECT c FROM Calificacion c WHERE c.periodoeva = :periodoeva"),
    @NamedQuery(name = "Calificacion.findByNovedad", query = "SELECT c FROM Calificacion c WHERE c.novedad = :novedad"),
    @NamedQuery(name = "Calificacion.findByLogro", query = "SELECT c FROM Calificacion c WHERE c.logro = :logro")})
public class Calificacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idCalificacion", nullable = false)
    private Integer idCalificacion;
    @Column(name = "calificacion", length = 32)
    private String calificacion;
    @Column(name = "periodoeva")
    private Integer periodoeva;
    @Column(name = "novedad", length = 100)
    private String novedad;
    @Column(name = "logro", length = 64)
    private String logro;
    @JoinColumn(name = "asignaturaId", referencedColumnName = "idAsignatura")
    @ManyToOne
    private Asignatura asignaturaId;
    @JoinColumn(name = "idEstudiante", referencedColumnName = "idEstudiante", nullable = false)
    @ManyToOne(optional = false)
    private Estudiante idEstudiante;

    public Calificacion() {
    }

    public Calificacion(Integer idCalificacion) {
        this.idCalificacion = idCalificacion;
    }

    public Integer getIdCalificacion() {
        return idCalificacion;
    }

    public void setIdCalificacion(Integer idCalificacion) {
        this.idCalificacion = idCalificacion;
    }

    public String getCalificacion() {
        return calificacion;
    }

    public void setCalificacion(String calificacion) {
        this.calificacion = calificacion;
    }

    public Integer getPeriodoeva() {
        return periodoeva;
    }

    public void setPeriodoeva(Integer periodoeva) {
        this.periodoeva = periodoeva;
    }

    public String getNovedad() {
        return novedad;
    }

    public void setNovedad(String novedad) {
        this.novedad = novedad;
    }

    public String getLogro() {
        return logro;
    }

    public void setLogro(String logro) {
        this.logro = logro;
    }

    public Asignatura getAsignaturaId() {
        return asignaturaId;
    }

    public void setAsignaturaId(Asignatura asignaturaId) {
        this.asignaturaId = asignaturaId;
    }

    public Estudiante getIdEstudiante() {
        return idEstudiante;
    }

    public void setIdEstudiante(Estudiante idEstudiante) {
        this.idEstudiante = idEstudiante;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCalificacion != null ? idCalificacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Calificacion)) {
            return false;
        }
        Calificacion other = (Calificacion) object;
        if ((this.idCalificacion == null && other.idCalificacion != null) || (this.idCalificacion != null && !this.idCalificacion.equals(other.idCalificacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Calificacion[idCalificacion=" + idCalificacion + "]";
    }

}
